/**
 * ...
 * @author Sasha
 */

package 
{

import flash.events.TextEvent;
import flash.geom.ColorTransform;
import flash.geom.Rectangle;
import flash.display.MovieClip;
import flash.display.DisplayObject;
import flash.events.MouseEvent;
import flash.text.TextField;

public class InvControl extends TPictureControl
{	
    private function onMove(e:MouseEvent): void
    {		
		if (Enabled)
		{
			var trans: ColorTransform = new ColorTransform(1, 1, 0, 0.5, 4, 4, 0.5, 1000);
			Ctrl.transform.colorTransform = trans;
		}
    }
	
	private function onMouseOut(e:MouseEvent): void
	{
		if (Enabled)
			Ctrl.transform.colorTransform = OrgTrans;
	}
	
   
   public override function set Enabled( v : Boolean ):void 
   {	 
	  if (!v)
	  {
		  var trans: ColorTransform = new ColorTransform(1, 1, 1, 0.5, 1, 1, 0.5, 0.5);
		  Ctrl.transform.colorTransform = trans;
	  }
	  if (v)
		  Ctrl.transform.colorTransform = OrgTrans;
	  super.Enabled = v;
   }	   
   
	public function InvControl(c: Class, Parent: TControl = null, x : Number = 0, y : Number = 0, anImg: DisplayObject = null)
	{		
		super (c, Parent, x, y, anImg);				
		addEventListener(MouseEvent.MOUSE_MOVE, onMove);
		addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
		
	}
}
}